package com.kkd.kkdapp.view.xlistview;


import com.kkd.kkdapp.R;
import com.kkd.kkdapp.view.ScrollerLayout;

import android.content.Context;
import android.util.AttributeSet;
import android.view.ViewGroup;
import android.widget.LinearLayout;

public class IndexScrollHeader extends LinearLayout{
	
	private Context mContext;
	private LinearLayout headerView;
	public IndexScrollHeader(Context context, AttributeSet attrs) {
		super(context, attrs);
		mContext = context;
		initUI();
	}

	public IndexScrollHeader(Context context, AttributeSet attrs,
			int defStyleAttr) {
		super(context, attrs, defStyleAttr);
		mContext = context;
		initUI();
	}

	public IndexScrollHeader(Context context) {
		super(context);
		mContext = context;
		initUI();
	}
	
	private void initUI() {
		headerView = (LinearLayout) LinearLayout.inflate(mContext,
				R.layout.index_refrash_header, null);
		ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(
				ViewGroup.LayoutParams.MATCH_PARENT,
				ViewGroup.LayoutParams.WRAP_CONTENT);
		addView(headerView,params);
	}
	
	public void changeHeaderViewByState(int state) {
		switch (state) {
		case ScrollerLayout.STATUS_IDLE:// 空闲状态
			break;
		case ScrollerLayout.STATUS_PULL_DOWN:// 下拉：不满足hold条件
			break;
		case ScrollerLayout.STATUS_PULL_UP:// 上拉：不满足hold条件
			break;
		case ScrollerLayout.STATUS_UP_HOLD:// 上拉后等待状态
			break;
		case ScrollerLayout.STATUS_DOWN_HOLD:// 下拉后等待状态
			break;
		case ScrollerLayout.STATUS_ANIMATING:// 回弹动画状态
			break;
		case ScrollerLayout.STATUS_PULL_DOWN_ENABLE:// 下拉：满足hold条件，松开将hold
			break;
		case ScrollerLayout.STATUS_PULL_UP_ENABLE: // 上拉：满足hold条件，松开将hold
			break;
		}
	}

}
